package com.youyiwen.Mapper;

import com.youyiwen.Bean.Comment;
import lombok.Data;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: zhaoyang
 * @Date: 2021/03/26
 */
@Mapper
public interface CommentMapper {
    public void insertComment(Comment comment);
    @Select("select * from comment where parent_id = #{parentId} order by type desc")
    public List<Comment> selectComments(String parentId);

    @Delete("delete from comment where id = #{id}")
    public void delectCommentById(String id);

    @Select("select commentator from comment where id = #{id}")
    public String selectCommentUserName(String id);
}
